package cn.com.api.mapper.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiU_dynamic_source;

//DAO
public interface U_dynamic_sourceMapperBase {

	// 根据id查看
	@Select("SELECT * FROM U_DYNAMIC_SOURCE  WHERE ID = #{id}")
	public ApiU_dynamic_source findU_dynamic_sourceById(Integer id);

	// 查看数据集
	@Select("SELECT * FROM U_dynamic_source")
	public List<ApiU_dynamic_source> findU_dynamic_sources();

	// //根据条件查看数据集
	// public List<Map<String, Object>> findU_dynamic_sourcesByMap(HashMap
	// condition);

	// 添加
	@Insert("INSERT INTO U_DYNAMIC_SOURCE (DYNAMIC_ID, SOURCE, SORT, TYPE) VALUES (#{dynamic_id}, #{source}, #{sort}, #{type})")
	@Options(useGeneratedKeys = true, keyProperty = "id")
	public int insertU_dynamic_source(ApiU_dynamic_source u_dynamic_source);

	// 修改
	@Update("UPDATE U_DYNAMIC_SOURCE SET DYNAMIC_ID = #{dynamic_id}, SOURCE = #{source}, SORT = #{sort}, TYPE = #{type} WHERE ID = #{id}")
	public int updateU_dynamic_source(ApiU_dynamic_source u_dynamic_source);

	// 删除
	@Delete("DELETE FROM U_DYNAMIC_SOURCE  WHERE ID = #{id}")
	public int deleteU_dynamic_source(Integer id);

	// Foreign keys revelant

	// region Indexs revelant

}
